﻿#ifndef MYCHARTVIEW_H
#define MYCHARTVIEW_H
#include <QObject>
#include <QtCharts>
#include <QChartView>
QT_CHARTS_USE_NAMESPACE
class MyChartView : public QChartView {
    Q_OBJECT

public:
    explicit MyChartView(QWidget *parent = nullptr) : QChartView(parent) {}

signals:
    void clicked();

protected:
    void mousePressEvent(QMouseEvent *event) override {
        if (event->button() == Qt::LeftButton) {
            emit clicked();
        }
        QChartView::mousePressEvent(event);
    }
};

#endif // MYCHARTVIEW_H
